#ifndef TOKEN_H_INCLUDED
#define TOKEN_H_INCLUDED

#define TokenType_None 0
//变量 字符串 各个进制的数值
#define TokenType_Variable 1
#define TokenType_String 2
#define TokenType_Hex 3
#define TokenType_Oct 4
#define TokenType_Decimal 5
#define TokenType_Bin 6
#define TokenType_Float 7
#define TokenType_Char 8
//注释
#define TokenType_Comment 9
//操作符号 块范围 { }
#define TokenType_BlockStart 10
#define TokenType_BlockEnd 11
//索引操作符号 [ ]
#define TokenType_IndexStart 12
#define TokenType_IndexEnd 13

//表示分号 ;  :
#define TokenType_End 14
#define TokenType_Extend  15

//最高优先,操作符号 ()
#define TokenType_BracketStart 16
#define TokenType_BracketEnd 17
//获取子项目操作符号
#define TokenType_Get 18

//常用计算操作符号 = + - * / %
#define TokenType_Equl 19
#define TokenType_Add 20
#define TokenType_Sub 21
#define TokenType_Mul 22
#define TokenType_Div 23
#define TokenType_Mod 24

//二元操作符号 += -= *= /= %=
#define TokenType_EAdd 25
#define TokenType_ESub 26
#define TokenType_EMul 27
#define TokenType_EDiv 28
#define TokenType_EMod 29
#define TokenType_Inc 30
#define TokenType_Dec 31

//移位之类的数据操作 | & ~ ^ << >>
#define TokenType_BitOr 32
#define TokenType_BitAnd 33
#define TokenType_BitNot 34
#define TokenType_BitXor 35
#define TokenType_LeftShift 36
#define TokenType_RightShift 37

#define TokenType_EBitOr 38
#define TokenType_EBitAnd 39
#define TokenType_EBitXor 40
#define TokenType_ELeftShift 41
#define TokenType_ERightShift 42

//逻辑操作 || && !
#define TokenType_Or 43
#define TokenType_And 44
#define TokenType_Not 45


//比较操作符号 > < == >= <= !=
#define TokenType_More 46
#define TokenType_Less 47
#define TokenType_EE 48
#define TokenType_EMore 49
#define TokenType_ELess 50
#define TokenType_ENot 51

//部分关键字
#define TokenKey_PACKAGE 52
#define TokenKey_IMPORT 53
#define TokenKey_ENUM 54
#define TokenKey_INTERFACE 55
#define TokenKey_CLASS 56
#define TokenKey_FUNCTION 57
#define TokenKey_PUBLIC 58
#define TokenKey_PROTECTED 59
#define TokenKey_PRIVATE 60
#define TokenKey_CONSTPRIVATE 61
#define TokenKey_CONSTPUBLIC 62
#define TokenKey_CONSTPROTECTED 63
#define TokenKey_FINAL 64
#define TokenKey_VIRTUAL 65
#define TokenKey_INLINE 66
//条件控制语句
#define TokenKey_IF 67
#define TokenKey_ELSE 68
#define TokenKey_WHILE 69
#define TokenKey_SWITCH 70
#define TokenKey_CASE 71
#define TokenKey_DEFAULT 72
#define TokenKey_CATCH 73
#define TokenKey_THROW 74
#define TokenKey_RETURN 75
#define TokenKey_CONTINUE 76
#define TokenKey_BREAK 77
#define TokenKey_OPERATOR 78
#define TokenKey_FOREACH 79
#define TokenKey_FOR 80
#define TokenType_Comma 81
#define TokenType_Index 82

typedef struct _token{
    int type; //字符串类型
    char *str; //字符串指针
    int len; //字符串长度
    char *name;
    int line; //字符串行数
}Token;

Token *TokenInit(int tokentype);
void TokenKeyCheck(Token *ptoken);

#endif // TOKEN_H_INCLUDED
